<template>
  <!-- 查看设备组件 -->
  <el-dialog
    title="设施列表"
    :visible.sync="showEquip"
    width="30%"
    class="dialogRec"
    :before-close="closeDialog"
  >
    <div class="facility-list">
      <div
        v-for="(item, index) in equipData"
        :key="index"
        class="facility-item"
      >
        <!-- {{ item.facilityName }} -->
        <div class="info-line">
          <div class="name">设施编号：</div>
          <div class="value">{{ item.facilityNo }}</div>
        </div>
        <div class="info-line">
          <div class="name">设施名称：</div>
          <div class="value">{{ item.facilityName }}</div>
        </div>
      </div>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button class="zh-button-one" @click="closeDialog">关 闭</el-button>
    </span>
  </el-dialog>
</template>

<script>
export default {
  props: {
    isShowEquip: {
      type: Boolean
    },
    equipData: {
      type: Array,
      default: () => []
    }
  },
  data () {
    return {
      showEquip: false
    }
  },
  watch: {
    isShowEquip: {
      handler (val) {
        // console.log(val, '222222222222222222')
        this.showEquip = val
      }
    }
  },
  created () {
    this.showEquip = this.isShowEquip
  },
  methods: {
    closeDialog () {
      this.showEquip = false
      this.$emit('closeDialog')
    }
  }
}
</script>

<style scoped lang='scss'>
.dialogRec.el-dialog__wrapper {
  ::v-deep  .el-dialog {
    height: auto;
    // width: 33% !important;
    .el-dialog__body {
      height: auto;
      overflow-y: auto;
      text-align: center;
      font-size: 18px;
      // color: red;
      letter-spacing: 2px;
      font-weight: 600;
      span {
        line-height: 100px;
      }
    }
    .el-dialog__footer {
      .Reconfirmation {
        background-color: #096f8f;
        border-radius: 6px;
      }
      .correct {
        background-color: #fff;
        color: #096f8f;
        border-radius: 6px;
        border: 1px solid #096f8f;
      }
    }
  }
}
.facility-list {
  display: flex;
  justify-content: flex-start;
  flex-direction: row;
  flex-wrap: wrap;
  .facility-item {
    width: 400px;
    max-width: 30%;
    min-width: 30%;
    margin-right: 3%;
    margin-bottom: 10px;
    // height: 80px;
    border-radius: 5px;
    // border: 1px solid #ccc;
    box-shadow: 1px 1px 10px rgba(0, 0, 0, 0.15);
    padding: 10px 20px;

    .info-line {
      display: flex;
      justify-content: flex-start;
      align-items: flex-start;
      font-size: 14px;
      &:not(:last-child) {
        margin-bottom: 10px;
      }
      .name {
        text-align: left;
        width: 80px;
        flex-shrink: 0;
      }
      .value {
        width: 100%;
        text-align: left;
        font-weight: normal;
      }
    }
  }
}
</style>
